<%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page import="org.springframework.security.web.WebAttributes" %>

<%
String showMsg = "";
String reMsg="";
if (session.getAttribute(WebAttributes.AUTHENTICATION_EXCEPTION) != null) {
	
	reMsg = session.getAttribute(WebAttributes.AUTHENTICATION_EXCEPTION).toString().split(":")[1];
	if (reMsg.equals(" Bad credentials")){
		showMsg = "用户密码不正确！";
	}else if(reMsg.equals(" User account is locked")){
		showMsg = "用户已被锁,请联系管理员解锁！";
	}else if(reMsg.equals(" User is disabled")){
		showMsg = "用户没有分配角色权限，请联系管理员分配！";
	}else if(reMsg.startsWith(" Maximum sessions")){
		showMsg = "该用户已经登录！";
	}else{
		showMsg = "用户不存在！";
	}
}

%>
<!DOCTYPE HTML>
<html>
<head>
<link rel="shortcut icon" href="images/favicon.ico">
<title>欢迎登陆 </title>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="zh-cn" />
<style type="text/css">
a, body, div, form, html, input, label, p, span {
	margin:0;
	padding:0
}
body {
	background:url(images/login/bg.jpg) top center #faf9f9 repeat-x;
	font-size:13px;
	width:100%
}
a {
	color:#fff;
	text-decoration:none
}
a:hover {
	text-decoration:underline
}
.logo {
	background:url(images/login/logo.jpg) no-repeat;
	height:53px;
	width:149px;
	margin:24px 0 0 40px
}
.warpper {
	width:1006px;
	margin:auto
}
.login {
	background:url(images/login/login_from.jpg) left top no-repeat;
	color:#fff;
	width:441px;
	height:261px;
	margin:90px 0 80px 290px
}
.login form {
	padding-left:150px;
	padding-top:68px
}
.login input.input {
	border:none;
	color:#cecece;	
	height:35px;
	line-height:35px;
	width:235px;
	margin:2px 0 28px 2px;
	margin-top:0\9;
	margin-left:0\9;
	margin-bottom:21px\9;
}
.co{color:#000}
.login input.input:focus {
	border:none;
	color:#000
}
.login .bottom {
	border:none;
	background:url(images/login/login_icon.gif) no-repeat;
	width:95px;
	height:33px;
	cursor:pointer;
	margin-right:16px
}
.login p.reset {
	position:absolute;
	line-height:33px
}
.login p.reset span {
	position:relative\9;
	top:-10px\9
}
.login a {
	margin-left:12px
}
.cooks {
	margin-top:-10px;
	margin-bottom:10px
}
.footer {
	border-top:1px #eee solid;
	color:#69B0E6;
	line-height:60px;
	text-align:center
}
</style>

<script>
var showMsg = '<%=showMsg%>';
if(showMsg != null &&showMsg != ""){
	alert(showMsg);
	showMsg = "";
	//alert(showMsg);
}
</script>
</head>
<body onload="document.forms[0].j_username.focus()">
<div class="warpper">
  <div class="logo"></div>
  <div class="login">
    <form name="login" id="login" method="post" action="<c:url value="/j_spring_security_check"/>">
      <p>
        <input type="text" required name="j_username"   class="input" />
      </p>
        
      <p>
        <input type="password" required name="j_password"   class="input" />
      </p>
      <p class="cooks">
        <label>
          <input type="checkbox" name="_spring_security_remember_me"   /> 两周内记住密码</label>
      </p>
      <p class="reset">
        <input type="submit" value=" " class="bottom" />
        <span> | <a href="javascript:void(0)" onClick="resetfrm('login')" title="重置">重置</a></span></p>
    </form>
  </div>
</div>
<div class="footer">  </div>
</body>
</html>
